<?php
require('databases.php');
  //Connect to DB
$dsn = 'mysql:dbname='.$donation_db.';host='.$donation_host;    
/*Try connecting to the DB*/  
try {  $dbh = new PDO($dsn, $sb_user, $sb_pass);  } catch(PDOException $e) {  echo $e->getMessage();  $this->dbcon = NULL;  return NULL;  }  
$con = mysql_connect(donation_host, donation_user, donation_pass);
mysql_select_db(donation_db, $con);
  //Create a table to keep track of time left
mysql_query("CREATE TABLE IF NOT EXISTS `donation_timeleft` (`steam_id` varchar(30) NOT NULL,`expires` date NOT NULL)");
  //Generate API key
$keyset  = "abcdefghijklmABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
$API_Key = "";
for ($i=0; $i<12; $i++)
$API_Key .= substr($keyset, rand(0, strlen($keyset)-1), 1);
  //Echo that install is complete
echo 'Install Complete. Please delete install.php and enter the key below into config.php';
echo $API_Key;
?>